package com.ssy.lingxi.system.controller;

import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.PageModel;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.system.dto.request.CreditIndexRequest;
import com.ssy.lingxi.system.dto.request.CreditIndexUpdateRequest;
import com.ssy.lingxi.system.entity.CreditIndex;
import com.ssy.lingxi.system.service.CreditIndexService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
 * @menu 会员设置-信用指数评估规则配置
 * @author wrc
 * @date 2020/7/20
 */
@Api(tags = "会员信用积分规则配置")
@RestController
public class CreditIndexController {


    @Autowired
    CreditIndexService creditIndexService;

    @ApiOperation(value = "查询会员信用分规则配置列表")
    @GetMapping("/credit/index/list")
    public Wrapper<PageData<CreditIndex>> creditIndexList(PageModel reqquest) {
        return creditIndexService.creditIndexList(reqquest);
    }


    @ApiOperation(value = "停用、启用会员信用积分规则配置")
    @PostMapping("/credit/index/stop/start")
    public Wrapper creditIndexStopAndStart(@RequestBody CreditIndexRequest request) {
        return creditIndexService.creditIndexStopAndStart(request);
    }

    @ApiOperation(value = "修改会员信用积分规则配置")
    @PostMapping("/credit/index/update")
    public Wrapper creditIndexUpdate(@RequestBody CreditIndexUpdateRequest request) {
        return creditIndexService.creditIndexUpdate(request);
    }








}
